﻿
	<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
						"http://www.w3.org/TR/html4/loose.dtd">
	<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="ml" lang="ml" dir="ltr">
	<head>
	  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
	   <script src="js/jquery-latest.js"></script>
	   <script src="js/swanalekha-ml.js"></script>
	  <link rel="stylesheet" href="css/jquery.treeview.css" type="text/css" />
	   <script type="text/javascript" src="js/jquery.treeview.js"></script>
	  <script type='text/javascript' src='js/jquery.autocomplete.js'></script>
	  <link rel="stylesheet" type="text/css" href="css/jquery.autocomplete.css" />
		<style type="text/css">
			@font-face {
			font-family: MyCustomFont;
			src: url("css/AnjaliOldLipi.eot") /* EOT file for IE */
			}
			@font-face {
			font-family: MyCustomFont;
			src: url("css/AnjaliOldLipi.ttf") /* TTF file for CSS3 browsers */
			}
			body {
			/*font: x-small sans-serif;*/
			background: #f9f9f9 url(headbg.jpg) 0 0 no-repeat;
			color: black;
			margin: 0;
			padding: 0;
		}
		 </style>
	  <script>
	  $(document).ready(function(){
		$("#example").treeview();
	  });
	  </script>

	</head>
	<body>
	<form action="" onsubmit="return false;">
	<input type="text" value="" id="topicsearch"/>
	<input type="button" id="searchbox" value="Go" name="പോകൂ" onclick="lookupLocal();"/>
	</form>
	<br/>
	<hr/>
	{$TOC$}
	<script type="text/javascript">
	function findValue(li) {
		if( li == null ) return alert("No match!");

		// if coming from an AJAX call, let's use the CityId as the value
		if( !!li.extra ) var sValue = li.extra[0];

		// otherwise, let's just display the value in the text box
		else var sValue = li.selectValue;
		var targetlink="#"
		$("a").each(function() { 
			if(sValue==$(this).html()){
				targetlink=this.href;
			}	
		});
		parent.content.location.href = targetlink;
	}

	function selectItem(li) {
		findValue(li);
	}

	function formatItem(row) {
		return row[0] + " (id: " + row[1] + ")";
	}
	function lookupLocal(){
		var oSuggest = $("#topicsearch")[0].autocompleter;

		oSuggest.findValue();

		return false;
	}

	$(document).ready(function() {
		var optionTexts = [];
		$("a").each(function() { optionTexts.push($(this).html()) });
		$("#topicsearch").autocompleteArray(
			optionTexts		,
			{
				delay:10,
				minChars:1,
				matchSubset:1,
				onItemSelect:selectItem,
				onFindValue:findValue,
				autoFill:false,
				maxItemsToShow:10
			}
		);
	});
	</script>
	</body>
	</html>
	
